package interfaceCustomer;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class CustomerPanel extends JPanel implements ActionListener {
	
	protected JButton btnLookUpOrder;
	private JButton btnCreateNewOrder ;
	private JButton btnSendComp;
	private JButton btnRenewSub;
	private JButton btnMakeSub;
	private JButton btnLogOut;
	private CustomerFrame cf;
	
	public CustomerPanel(CustomerFrame _cf)   {
		
		this.setLayout(null);
		cf=_cf;
		
		btnLookUpOrder = new JButton("Look Up Order");
		btnLookUpOrder.setBounds(27, 152, 192, 25);
		btnLookUpOrder.addActionListener(this);
		
		btnCreateNewOrder = new JButton("Create New Order");
		btnCreateNewOrder.setBounds(27, 9, 192, 25);
		btnCreateNewOrder.addActionListener(this);
			
		btnSendComp = new JButton("Send Complaint");
		btnSendComp.setBounds(27, 47, 192, 25);
		btnSendComp.addActionListener(this);
		
		btnRenewSub = new JButton("Renew Subscription");
		btnRenewSub.setBounds(27, 117, 192, 25);
		btnRenewSub.addActionListener(this);
		
		btnMakeSub = new JButton("Make Subscription");
		btnMakeSub.setBounds(27, 82, 192, 25);
		btnMakeSub.addActionListener(this);
		
		btnLogOut = new JButton("LogOut");
		btnLogOut.setBounds(27, 210, 192, 25);
		btnLogOut.addActionListener(this);
		
		this.add(btnLookUpOrder);
		this.add(btnCreateNewOrder);
		this.add(btnSendComp);
		this.add(btnRenewSub);
		this.add(btnMakeSub);
		this.add(btnLogOut);
		
		this.setVisible(true);
	}
	
	
	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == btnLogOut)
		{
			cf.ChangePanel(6);
		}
		if(e.getSource() == btnSendComp) {
			cf.ChangePanel(2);
		}
		if(e.getSource() == btnMakeSub) {
			cf.ChangePanel(3);
		}
		if(e.getSource() == btnRenewSub) {
			cf.ChangePanel(4);
		}
		if(e.getSource() == btnLookUpOrder) {
			cf.ChangePanel(5);
		}
		if(e.getSource() == btnCreateNewOrder) {
			cf.ChangePanel(1);
		}		
	}
	
	

}
